import cv2
import numpy as np

def main():
    img = cv2.imread("3/lena_color.jpg")

    if img is not None:
        w, h = img.shape[:2]
        src = np.float32([[0, 0], [0, 255], [255, 0]])
        dst = np.float32([[100, 200], [100, 455], [355, 200]])
        M = cv2.getAffineTransform(src, dst)
        print(M)
        result = cv2.warpAffine(img, M, (h, w))
        cv2.imshow("img", img)
        cv2.imshow("result", result)
        cv2.waitKey()
        cv2.destroyAllWindows()
    else:
        print("failed to load image")

if __name__ == '__main__':
    main()